import request from '@/utils/request'

/* 获取部门列表
@request*/

export function getDepartments() {
  // 配置url,method,参数 data,params
  return request({
    url: 'company/department'
  })
}
export function getDepartmentDetail(id) {
  // 配置url,method,参数 data,params
  return request({
    url: `company/department/${id}`
  })
}
export function addDepartments(data) {
  // 配置url,method,参数 data,params
  return request({
    url: 'company/department',
    method: 'POST',
    data
  })
}
export function updateDepartments(data) {
  // 配置url,method,参数 data,params
  return request({
    url: `company/department/${data.id}`,
    method: 'put',
    data
  })
}
export function delDepartments(id) {
  // 配置url,method,参数 data,params
  return request({
    url: `company/department/${id}`,
    method: 'delete'

  })
}
